package com.example.service;

import com.example.dao.ClassInfoDao;
import com.example.dao.TeacherInfoDao;
import com.example.entity.ClassInfo;
import com.example.entity.TeacherInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 涛某
 * @version 1.0
 * @date 2024/3/27 9:34
 */
@Service
public class ClassInfoService {
    @Autowired
    private ClassInfoDao classInfoDao;
    @Autowired
    private TeacherInfoDao teacherInfoDao;

    public List<ClassInfo> findAll() {
       List<ClassInfo> list =   classInfoDao.findAll();
        return  list;
    }


    public void add(ClassInfo classInfo) {
         classInfoDao.add(classInfo);
    }

    public void update(ClassInfo classInfo) {
        classInfoDao.updateByPrimaryKey(classInfo);
    }

    public void del(Long id) {
        classInfoDao.del(id);
    }

    public List<ClassInfo> findsearch(String search) {
        return classInfoDao.findSearch(search);
    }
}
